<div class="page_function">
  <div class="info">
    <h3>栏目管理</h3>
    <small>使用以下功能进行栏目添加操作</small> </div>
  <div class="exercise"> 
   <a href="javascript:menuload('__URL__')">栏目列表</a>
   <?php if(model('user_group')->model_power('category','add')){ ?>
   <!--foreach:{$model_list $vo}-->
   <a href="javascript:menuload('__APP__/{$vo.model}_category/add')">添加{$vo.name}栏目</a>
   <!--{/foreach}-->
   <?php } ?>
   
   </div>
</div>
<div class="page_main">
  <div class="page_table table_list">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <th width="10%"><center>ID</center></th>
        <th width="25%">栏目名称</th>
        <th width="10%"><center>顺序</center></th>
        <th width="10%"><center>栏目显示</center></th>
        <th width="15%"><center>栏目属性</center></th>
        <th width="15%"><center>栏目类型</center></th>
        <th width="15%"><center>栏目操作</center></th>
      </tr>
      <!--foreach:{$list $vo}-->
      <tr>
        <td><center>{$vo.cid}</center></td>
        <td><a href="<?php echo ROOTAPP ?>/label/admin_curl/cid-{$vo['cid']}.html" target="_blank">{$vo.cname}</a>
        <!--if:{$vo['image']<>''}-->
        <a href="javascript:;" rel="{$vo.image}" class="class_pic"><img align="AbsMiddle" src="__PUBLICURL__/images/ico/pic.png" width="14" height="14" alt="" /></a>
        <!--{/if}-->
        </td>
        <td><center>
        <?php if(model('user_group')->model_power('category','edit')){ ?>
        <input type="text" value="{$vo.sequence}" class="sequence" onblur="sequence({$vo['cid']},$(this).val())" />
        <?php }else{ ?>
        {$vo.sequence}
        <?php } ?>
        </center></td>
        <td><center>
        <!--if:{$vo['show']==1}-->
        <font color=green><b>√</b></font>
        <!--{else}-->
        <font color=red><b>×</b></font>
        <!--{/if}-->
        </center></td>
        <td><center>
        <!--if:{$vo['type']==0}-->
        频道
        <!--{else}-->
        列表
        <!--{/if}-->
        </center></td>
        <td><center>{$vo.mname}</center></td>
        <td><center>
        <?php if($edit_power){ ?>
        <a href="__APP__/{$vo.admin_category}/edit/id-{$vo.cid}">修改</a>
        <?php } ?>
        <?php if($del_power){ ?>
        &nbsp;&nbsp;<a href="javascript:void(0);" onclick="del('__APP__/{$vo.admin_category}/del','{$vo.cid}',this)">删除</a>
        <?php } ?>
        </center>
         </td>
      </tr>
      <!--{/foreach}-->
    </table>
  </div>
</div>

<div class="page_tool">
  <div class="page"></div>
</div>
<script>
//栏目形象图
$(".class_pic").powerFloat({
    targetMode: "ajax"
});
//栏目删除
function del(url,cid,obj) {
	var obj;
	ajaxpost({
		name:'删除此栏目会删除栏目下的内容!',
		url:url,
		data:{cid:cid},
		tip:true,
		success:function(){
			$(obj).parent().parent().parent().remove();
		}
	});
}
//栏目排序
function sequence(cid,sid){
	ajaxpost_w({
		url:'__URL__/sequence',
		data:{ cid:cid, sequence:sid },
		tip:1
	});
}
</script>